<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class OrderEvaluate extends Model
{
    protected $table = "order_evaluate";
    protected $guarded = [];

    public function user(){
        return $this->belongsTo(User::class,"userid","id");
    }

    public function getImageAttribute()
    {
        $exp = explode(',',$this->attributes['image']);
        $imageArray = [];
        foreach ($exp as $item){
            $imageArray[] = Wechart::PATH_IMAGE.'uploads/'.$item;
        }
        return $imageArray;
    }
}
